package com.zdzx.model.service.base.vo;


import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.zdzx.model.entity.BaseEntity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "用户", description = "用户")
@TableName("base_user")
public class User extends BaseEntity implements Serializable{
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@ApiModelProperty(value = "租户id", name = "tenantId")
	private String tenantId;
	@ApiModelProperty(value = "账号", name = "account")
	private String account;
	
	@ApiModelProperty(value = "密码", name = "password")
	private String password;
	
	@ApiModelProperty(value = "密码", name = "realName")
	private String realName;
	
	@ApiModelProperty(value = "邮箱", name = "email")
	private String email;
	
	@ApiModelProperty(value = "头像", name = "headUrl")
	private String headUrl;
	
	@ApiModelProperty(value = "手机号", name = "mobile")
	private String mobile;
	
	@ApiModelProperty(value = "状态", name = "status")
	//@TableField("`status`")
	private String  status;
	
	@ApiModelProperty(value = "类型", name = "type")
	//@TableField("`type`")
	private String type;
	
	@ApiModelProperty(value = "角色类型0学生  1教师", name = "roleType")
	private String roleType;
	
	@ApiModelProperty(value = "身份证", name = "idCard")
	private String idCard;
	
	@JsonDeserialize(using = LocalDateTimeDeserializer.class)
	@JsonSerialize(using = LocalDateTimeSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "最后登录时间时间", name = "lastLoginTime",example = "2019-09-09 00:00:00")
	private LocalDateTime lastLoginTime;
	
	@ApiModelProperty(value = "1是 0否", name = "isVip")
	private String isVip;
	
	private String company;
	
	@TableField(exist = false)
	private List<UserRole> userRole;
	/*
	public void setHeadUrl(String headUrl,boolean flag) {
		if(!StringUtils.isEmpty(headUrl)&&!headUrl.contains(SystemConfig.ossIp)&&flag)
		this.headUrl = SystemConfig.ossIp+headUrl;
		else
		this.headUrl=headUrl;
	}
	public void setHeadUrl(String headUrl) {
		if(!StringUtils.isEmpty(headUrl)&&!headUrl.contains(SystemConfig.ossIp))
		this.headUrl = SystemConfig.ossIp+headUrl;
		else
		this.headUrl=headUrl;
	}
*/
}